package ru.store.paysystem;

public class SpyPaySystem implements IPaySystem {
	private boolean isCalled = false;
	private float amount = 0;
	
	@Override
	public void increaseProfit(float amount) throws ExceptionInvalidAmount {
		if (amount <= 0)
			throw new ExceptionInvalidAmount(amount);
		this.amount += amount;
		isCalled = true;
	}

	@Override
	public void setAmount(float amount) {
		this.amount = amount;
	}

	@Override
	public float getAmount() {
		return amount;
	}

	@Override
	public boolean getIsCalled(boolean clearFlag) {
		boolean result = isCalled;
		isCalled = false;
		return result;
	}

}
